<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.tjsinfo.tjsoa.common.DealString"%>
<%@page import="com.tjsinfo.tjsoa.vote.vo.TVoteHead"%>
<%@page import="com.tjsinfo.tjsoa.vote.vo.TVoteConformation"%>
<%@page import="com.tjsinfo.tjsoa.vote.vo.TVoteColumn"%>
<%@page import="com.tjsinfo.tjsoa.vote.vo.TVoteEstimated;"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	List<TVoteColumn> columnLists = (List) request.getAttribute("columnLists");
	List<TVoteConformation> conformationParentLists = (List) request.getAttribute("conformationParentLists");
	List<TVoteConformation> conformationLists = (List) request.getAttribute("conformationLists");
	List<TVoteEstimated> estimatedLists = (List) request.getAttribute("estimatedLists");
	String name = "";
	String post = "";
	for (TVoteEstimated estimatedList : estimatedLists) {
	    name = name + estimatedList.getName()+",";
	    post = post + estimatedList.getPost()+",";
	}
	
	TVoteHead head = (TVoteHead) request.getAttribute("head");
	DealString ds = new DealString();
	String title = head.getName();
	String remark = head.getRemark();
	if (title.length() > 30)title = ds.substring(title, 30);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>粮油集团办公自动化协作平台</title>
		<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" />
		<style>
			.jkd1231 {
				border-left: 1px #d0d0d0 solid;
				border-bottom: 1px #d0d0d0 solid;
				margin: 16px auto;
			}
			
			.jkd1231 th {
				border-top: 1px #d0d0d0 solid;
				border-right: 1px #d0d0d0 solid;
				padding-top: 6px;
				padding-bottom: 6px;
				color: #666666;
				font-weight: bold;
				text-align: center
			}
			
			.jkd1231 td {
				border-top: 1px #d0d0d0 solid;
				border-right: 1px #d0d0d0 solid;
				height: 30px;
				color: #232323;
				text-align: left;
				padding-left: 3px
			}
		</style>
	</head>
	<body>
		<div id="rightindex" style="height:97%">
			<div id="tab" style="width:99%">
				<div id="index_main">
					<div style="overflow-y: scroll; height: 550px;">
						<table width="98%" border="0" cellspacing="0" cellpadding="0" class="jkd1231">
							<tr>
								<th colspan="4">
									<%=title%>
								<br /></th>
							</tr>
							<tr>
								<th width="17%">
									姓名
								</th>
								<td width="30%">
								    <%=name%>
								</td>
								<th width="19%">
									职务
								</th>
								<td width="34%">
									<%=post%>
								</td>
							</tr>
							<%
								if (conformationParentLists.size() > 0) {
							%>
							<%
								    for (int i = 0; i < conformationParentLists.size(); i++) {
										String radioId = conformationParentLists.get(i).getId().toString();
							%>
							<tr>
								<th rowspan="<%=conformationParentLists.get(i).getRowNum()%>">
									<%=conformationParentLists.get(i).getName()%>
								</th>
								<%
									         for (int j = 0; j < conformationLists.size(); j++) {
												  String a = conformationParentLists.get(i).getId();
												  String b = conformationLists.get(j).getParentId();
												  if (a.equals(b)) {
													  String radioIdj = conformationLists.get(j).getId().toString();
								%>
								<td colspan="2">
									<%=conformationLists.get(j).getName()%>
								</td>
								<td>
									<%
										              for (int k = 0; k < columnLists.size(); k++) {
														   String c = conformationParentLists.get(i).getId();
														   String d = columnLists.get(k).getConId();
														   if (c.equals(d)) {
															   String radioIdk = conformationLists.get(j).getId().toString();
									%>
									<label>
										<input type="radio" name="<%=radioIdk%>" id="radio" value="radio" />
									</label>
									<%=columnLists.get(k).getName()%>&nbsp;
									<%
										                   }
													  }
									%>
								</td>
							</tr>
							<%
								                   }
										        }
							%>
							<%
								         }
							%>
							<%
								    }
							%>
							<tr>
								<th>
									备注
								</th>
								<td colspan="3">
									<textarea name="textarea3" id="textarea3" cols="68" rows="4" style="border: 1px #ddd solid; background: #F4F4F4"><%=remark%></textarea>
								</td>
							</tr>
							<tr>
								<th>
									投票人

								</th>
								<td  colspan="3">
									<%=head.getVoteName()%>
								</td>
							</tr>
						</table>
						<table  width="700" border="0" cellspacing="0" cellpadding="0">
						    <tr>
								<td width="311" height="30" align="left" valign="middle">
									&nbsp;
								</td>
								<td width="79" align="center" valign="middle">
									<a href="<%=basePath%>tjsinfo/tjsoa/vote/headList.do"><font color="blue">返回</font></a>
								</td>
								<td width="310" align="center" valign="middle">
									&nbsp;
								</td>								
							</tr>
						</table>
					</div><div class="clear"></div>
				</div>
			</div>
		</div>
	</body>
</html>
